package com.ptma.dao.i;

import java.util.List;

import javax.persistence.PersistenceException;

import org.hibernate.Session;
import org.hibernate.exception.ConstraintViolationException;

public interface IGenericDao<T, ID> {

	public Session openSession();

	public T save(ID objToSave) throws PersistenceException,
			ConstraintViolationException;

	public List<T> findAllById(ID objtToFind) throws PersistenceException,
			ConstraintViolationException;

	public T findById(ID objtToFind);

	public boolean isExist(ID objToCheck);

	public void saveOrUpdate(ID objToSave) throws PersistenceException,
			ConstraintViolationException;

	public void update(ID objToUpdate) throws PersistenceException;

	public void delete(T objToDelete) throws PersistenceException,
			ConstraintViolationException;
}
